 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="description" content="" />
    <meta name="author" content="ChongMing" />
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="full-screen" content="yes">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-fullscreen" content="true">
    <meta name="360-fullscreen" content="true">
    <title>立即预约</title>
</head>
<link href="../css/reset.min.css" rel="stylesheet" type="text/css" />
<link href="../css/examination/layout.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../css/ekang.css"/>
<script src="../js/jquery.min.js"></script>
<script src="../js/jquery.mobile-1.4.3.js"></script>
<script src="../js/main.js"></script>
<script src="../js/ekang.js"></script>
<script src="../js/jquery.cookie.js"></script>
<script>
    $(function(){
        var  package_id = getQueryString("package_id");
        var  physical_id = getQueryString("physical_id");
        var sex = 'm';
        $('.appointment .appointment_table .sex .sex_man').click(function(){
            sex = 'm';
            $(this).addClass('hover').siblings().removeClass('hover')
        });
        $('.appointment .appointment_table .sex .sex_woman').click(function(){
            sex = 'f';
            $(this).addClass('hover').siblings().removeClass('hover')
        });

       $('.appointment .appointment_sub').click(function(){
           var name = $('.appointment .appointment_table .name input').val();
           var phone = $('.appointment .appointment_table .phone input').val();
           var age = $('.appointment .appointment_table .age input').val();
           var textArea = $('.appointment .appointment_table textarea').val();
           if(!obj.name.test(name)){
               prompt('姓名必填')
           }else if(phone==''){
               prompt('手机号必填')
           }else if(!obj.phone.test(phone)){
               prompt('手机号格式不正确')
           }else{
               //alert(12)
               $.ajax({
                   type:'POST',
                   url:textUrl+'/wish/index/add_forign_health/',
                   data:{
                       uid : $.cookie("local_userId"),
                       name : name,
                       physical_id : physical_id,
                       package_id : package_id,
                       sex : sex,
                       age : age,
                       mobile : phone,
                       desc : $('#desc_content').val()
                   },
                   dataType:'json',
                   success:function(res){
                       if(res.ret==0){
                           //请求成功
                           alert('预约成功')
//                           location.href = 'http://www.ekangjiuyi.net/EKang2.0/index.html'
                       }else{
                           //请求失败
                           alert(res.msg)
                       }
                   }
               });
           }
       });
    });
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }
</script>
<script>
    $(function(){
        $('#back').click(function(){
            history.go(-1)
        })
    });
</script>
<style>
    label{
        color: #000;
    }
</style>
<body style=" font-family: '微软雅黑';">
<!--// 导航条-->
<div class="header_top" style="width: 100%;height: 45px;background-color: #38a16d;position: fixed;z-index: 10000">
    <h1 class="nav-title" style="font-size: 18px;">立即预约</h1>
    <img src="../img/BackIcon.png" alt="返回" class="nav-backImg" id="back"/>
</div>
<div class="top45" style=" width: 100%; height: 45px"></div>
<div class="appointment">
    <div class="appointment_table">
        <div class="name">
            <label>您的姓名</label>
            <input placeholder="请填写您的姓名"/>
            <p>*</p>
        </div>
        <div class="sex">
            <label>您的姓名</label>
            <div class="sex_man hover">男</div>
            <div class="sex_woman">女</div>
        </div>
        <div class="name age">
            <label>您的年龄</label>
            <input placeholder="请填写您的年龄"/>
        </div>
        <div class="name phone">
            <label>您的电话</label>
            <input placeholder="请填写您的电话"/>
            <p>*</p>
        </div>
        <textarea placeholder="请填写您的就医诉求" id="desc_content"></textarea>
    </div>
    <button class="appointment_sub">马上提交</button>
</div>
</body>
</html>
